package com.gzpi.hwgggh.utils;

import org.springframework.beans.factory.annotation.Value;

import java.io.File;
import java.util.Map;

/**
 * @date : 2021-01-04 09:44
 **/
public class HwggConstants {

    public static String getPath(){
        String path = SAVE_PATH;
        if (SAVE_PATH.startsWith("file:///")){
            path = SAVE_PATH.substring("file:///".length());
        }
        if (!path.endsWith("/")&&!path.endsWith(File.separator)){
            return path+"/";
        }
        return path;
    }

    public static String getPanFu(){
        String path = getPath();
        return path.substring(0,path.indexOf("/")+1);
    }

    public static String SAVE_PATH=""; //文件保存的物理路径
    public static String MAPPING_PATH="";//文件的映射路径

    public static Integer GGP_NUM = 3; //广告牌数量

    public  static     void   resetNewPath(  String  SAVE_PATH,String  MAPPING_PATH){
        HwggConstants.SAVE_PATH = SAVE_PATH;
        HwggConstants.MAPPING_PATH = MAPPING_PATH;
    }

}
